package nuc.ss.wl.service.impl;

import nuc.ss.wl.dao.StudentDao;
import nuc.ss.wl.dao.impl.StudentDaoImpl;
import nuc.ss.wl.entity.Student;
import nuc.ss.wl.service.StudentService;

import java.util.List;
import java.util.Map;

public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao = new StudentDaoImpl();

    @Override
    public int add(Student student) {
        return this.studentDao.save(student);
    }

    @Override
    public int delete(int sno) {
        return this.studentDao.delete(sno);
    }

    @Override
    public int update(Student student) {
        return this.studentDao.update(student);
    }

    @Override
    public List<Student> findAll() {
        return this.studentDao.findAll();
    }

    @Override
    public Student findBySno(int sno) {
        return this.studentDao.findBySno(sno);
    }

    @Override
    public Map<Float, Student> findStudentByClassno(int classno) {
        return this.studentDao.findStudentByClassno(classno);
    }

    @Override
    public Student login(int sno, String password) {
        return null;
    }
}
